<?php
	session_start();
	$username = $_POST['username'];
	$password = $_POST['password'];
	include("../function.php");
	$conn = conn();

	$result = mysqli_query($conn, "select * from mesadmin where username ='$username' and password = '$password'");
	$result = mysqli_fetch_assoc($result);
	if ($result) {
		$_SESSION['is_login'] = 'ok';
		$_SESSION['user_name'] = $result['username'];
		//setcookie("is_login","ok",0,"/blog/message");
		header("Location:../index.php");
	}else{
		$_SESSION['is_login'] = 'no';
		//setcookie("is_login","no");
		header("Location:../index.php");
	}
?>